import pandas as pd
import matplotlib.pyplot as plt

print("matplotlib学习案例")


# 绘制一个简单的折线图
data = pd.read_excel('F-10.xlsx')
# print(data)

# fig = plt.figure(1,(4,4),facecolor='b',edgecolor='g')


# 支持中文
plt.rcParams['font.sans-serif'] = ['SimHei']  # 用来正常显示中文标签
plt.rcParams['axes.unicode_minus'] = False  # 用来正常显示负号
plt.title('F-10')

# fig = plt.figure(1,(8,4))
x = data['实际时间']
print(x)
y = data['电流']
# print(x)
# print(y)

# plt.ylabel('电流')
plt.xlabel('实际时间')
plt.plot(x,y,'r')

# fig2 = plt.figure(2,(8,4))
# plt.title('F-10')
# plt.ylabel('排气压力')
# plt.xlabel('实际时间')
y = data['排气压力']
plt.plot(x,y,'g')


# fig3 = plt.figure(3,(8,4))
plt.title('F-10')
# plt.ylabel('吸气压力')
# plt.xlabel('实际时间')
y = data['吸气压力']
plt.plot(x,y,'b')

plt.show()



